- page_title _("Observability")
- add_page_specific_style 'page_bundles/observability'

.observability-container.gl-flex.gl-flex-col
  .gl-flex.gl-items-center.gl-mt-3.gl-mb-5
    %h1.gl-heading-1
      = s_(@data.title)
      - if @data.to_h[:o11y_url].present?
        = link_to @data.url_with_path.to_s, target: '_blank', rel: 'noopener noreferrer', class: 'gl-ml-3', title: _('Opens in a new window') do
          = sprite_icon('external-link', css_class: 'gl-mr-3', size: 18)

  - if @data&.auth_tokens.blank?
    = render Pajamas::AlertComponent.new(dismissible: false, variant: :danger, title: _('Unable to authenticate with the observability service. Please check your configuration and try again.'))
  - elsif @data.provisioning?
    = render Pajamas::AlertComponent.new(dismissible: false, variant: :info, title: _('The observability service is initializing. Please try again in a few minutes.'))
  - else
    #js-observability{ data: @data.to_h }
